home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / mcu / dtmf.arc / DTMF11.LST < prev    next >
File List  |  1989-12-17  |  15KB  |  254 lines

  1. M68HC11 Portable Cross Assembler  0.05   MS-DOS/PC-DOS  Page 1
  2.  Sun Dec 17 12:23:27 1989 
  3. Command line: 
  4.  C:\MOT\DTMF\..\pasms\PASMHC11.EXE -l dtmf11.lst dtmf11.asm
  5. Options list: 
  6. ON  - b - Printing of macro definitions
  7. ON  - c - Printing of macro calls
  8. OFF - d - Placing of symbolic debugging information in COFF
  9. OFF - e - Printing of macro expansions
  10. ON  - f - Printing of conditional directives
  11. OFF - g - Printing of generated constants list
  12. OFF - q - Expanding and printing of structured syntax
  13. OFF - s - Printing of symbol table
  14. OFF - u - Printing of conditional unassembled source
  15. OFF - x - Printing of cross reference table
  16. OFF - m - Suppress printing of error messages
  17. ON  - w - Printing of warning messages
  18. OFF - v - Suppress printing of updated status
  19. OFF - y - Enabling of sgs extensions
  20. ON  - o - Create object code
  21. ON  -   - Formatting of source line listing 
  22. Create listing file - l - dtmf11.lst 
  23.  
  24. Xdefs: 
  25.   NONE 
  26.  
  27. Xrefs: 
  28.   NONE 
  29.  
  30. Input file(s): dtmf11.asm (151 lines) 
  31.                sine56.asm (32 lines) 
  32.  
  33. Output file: dtmf11.o  
  34. Listing file: dtmf11.lst 
  35.  
  36. M68HC11 Portable Cross Assembler  0.05  dtmf11.asm  Page 2
  37.  Sun Dec 17 12:23:27 1989  
  38. Options - MD,MC,NOG,NOU,W,NOMEX,CL,FMT,O
  39.  
  40. LINE   S PC   OPCO OPERANDS  S LABEL    MNEMO OPERANDS COMMENT
  41. 00001                          * File: DTMF11.ASM
  42. 00002                          * Driver routines for 68HC11 to produce DTMF tones in software
  43. 00003                          
  44. 00004                          * this version uses a fixed 256 byte sine table, and a fixed 128 us sample time
  45. 00005                          * this allows operation under interrupt control
  46. 00006                          
  47. 00007                          * hardware requirements: 8 bit DAC on port b of 68HC11
  48. 00008                          * To use, do a JSR to DTINIT to set up timer
  49. 00009                          * then do a JSR to location DTMF with the digit in the lower nibble of
  50. 00010                          * Accumulator A
  51. 00011                          * digit values: 0-9, 10 = #, 11 = *, 12-15 represent a through d
  52. 00012                          * A 60 ms tone burst will be generated, followed by 60 ms of silence
  53. 00013                          * The location TTIME may be altered to change this timing
  54. 00014                          
  55. 00015                                   asct           
  56. 00016                          
  57. 00017                          * First a few definitions
  58. 00018                          
  59. 00019  A 0000      1000      A io       equ   $1000    offset for i/o registers
  60. 00020  A 0000      003c      A deftt    equ   60       default tone time (60 ms)
  61. 00021  A 0000      1004      A dac      equ   io+4     DAC output on port a
  62. 00022  A 0000      100e      A tcnt     equ   io+$e    timer free running counter
  63. 00023  A 0000      1016      A ocr1     equ   io+$16   output compare register
  64. 00024  A 0000      1022      A tmsk1    equ   io+$22   int mask register
  65. 00025  A 0000      1023      A tflg1    equ   io+$23   int flag register
  66. 00026  A 0000      0080      A ocie     equ   $80      output compare interrupt enable
  67. 00027  A 0000      0100      A intcnt   equ   128*2    count to load into output compare
  68. 00028                          
  69. 00029  A 0000      0017      A row1     equ   23       row intervals
  70. 00030  A 0000      0019      A row2     equ   25       
  71. 00031  A 0000      001c      A row3     equ   28       
  72. 00032  A 0000      001f      A row4     equ   31       
  73. 00033                          
  74. 00034  A 0000      0028      A col1     equ   40       column intervals
  75. 00035  A 0000      002c      A col2     equ   44       
  76. 00036  A 0000      0030      A col3     equ   48       
  77. 00037  A 0000      0036      A col4     equ   54       
  78. 00038                          
  79. 00039  A 0000                           org   $0       RAM scratchpad - move this to fit your system
  80. 00040  A 0000      01        A ttime    rmb   1        tone time in milliseconds
  81. 00041  A 0001      02        A ttctr    rmb   2        time counter
  82. 00042  A 0003      02        A ttsave   rmb   2        save the count value for interdigit pause
  83. 00043  A 0005      01        A ttflag   rmb   1        non zero means generate tones
  84. 00044  A 0006      02        A rowptr   rmb   2        next row sample to load
  85. 00045  A 0008      02        A colptr   rmb   2        ditto for columns
  86. 00046  A 000a      01        A rowint   rmb   1        row interval - added to row counter each sample
  87. 00047  A 000b      01        A colint   rmb   1        ditto for column
  88. 00048  A 000c      01        A sample   rmb   1        temp storage for sample
  89. 00049                          
  90. 00050                          * sine is the 256 byte sine wave table
  91. 00051                          * this must be located on a page boundary! (ie lower 8 bits of address = 0)
  92. 00052                          
  93.  
  94. M68HC11 Portable Cross Assembler  0.05  dtmf11.asm  Page 3
  95.  Sun Dec 17 12:23:27 1989  
  96. Options - MD,MC,NOG,NOU,W,NOMEX,CL,FMT,O
  97.  
  98. LINE   S PC   OPCO OPERANDS  S LABEL    MNEMO OPERANDS COMMENT
  99. 00053  A 1000                           org   $1000    
  100. 00054                          
  101. 00055                                   include sine56.asm
  102. 00001  A 1000      0001030405A sine     fcb   0,1,3,4,5,7,8,10
  103. 00002  A 1008      0b0c0e0f10A          fcb   11,12,14,15,16,18,19,20
  104. 00003  A 1010      151718191aA          fcb   21,23,24,25,26,28,29,30
  105. 00004  A 1018      1f20212224A          fcb   31,32,33,34,36,37,38,39
  106. 00005  A 1020      2829292a2bA          fcb   40,41,41,42,43,44,45,46
  107. 00006  A 1028      2f2f303131A          fcb   47,47,48,49,49,50,51,51
  108. 00007  A 1030      3434353536A          fcb   52,52,53,53,54,54,54,55
  109. 00008  A 1038      3737373838A          fcb   55,55,55,56,56,56,56,56
  110. 00009  A 1040      3838383838A          fcb   56,56,56,56,56,56,55,55
  111. 00010  A 1048      3737363636A          fcb   55,55,54,54,54,53,53,52
  112. 00011  A 1050      3433333231A          fcb   52,51,51,50,49,49,48,47
  113. 00012  A 1058      2f2e2d2c2bA          fcb   47,46,45,44,43,42,41,41
  114. 00013  A 1060      2827262524A          fcb   40,39,38,37,36,34,33,32
  115. 00014  A 1068      1f1e1d1c1aA          fcb   31,30,29,28,26,25,24,23
  116. 00015  A 1070      1514131210A          fcb   21,20,19,18,16,15,14,12
  117. 00016  A 1078      0b0a080705A          fcb   11,10,8,7,5,4,3,1
  118. 00017  A 1080      00fffdfcfbA          fcb   0,-1,-3,-4,-5,-7,-8,-10
  119. 00018  A 1088      f5f4f2f1f0A          fcb   -11,-12,-14,-15,-16,-18,-19,-20
  120. 00019  A 1090      ebe9e8e7e6A          fcb   -21,-23,-24,-25,-26,-28,-29,-30
  121. 00020  A 1098      e1e0dfdedcA          fcb   -31,-32,-33,-34,-36,-37,-38,-39
  122. 00021  A 10a0      d8d7d7d6d5A          fcb   -40,-41,-41,-42,-43,-44,-45,-46
  123. 00022  A 10a8      d1d1d0cfcfA          fcb   -47,-47,-48,-49,-49,-50,-51,-51
  124. 00023  A 10b0      cccccbcbcaA          fcb   -52,-52,-53,-53,-54,-54,-54,-55
  125. 00024  A 10b8      c9c9c9c8c8A          fcb   -55,-55,-55,-56,-56,-56,-56,-56
  126. 00025  A 10c0      c8c8c8c8c8A          fcb   -56,-56,-56,-56,-56,-56,-55,-55
  127. 00026  A 10c8      c9c9cacacaA          fcb   -55,-55,-54,-54,-54,-53,-53,-52
  128. 00027  A 10d0      cccdcdcecfA          fcb   -52,-51,-51,-50,-49,-49,-48,-47
  129. 00028  A 10d8      d1d2d3d4d5A          fcb   -47,-46,-45,-44,-43,-42,-41,-41
  130. 00029  A 10e0      d8d9dadbdcA          fcb   -40,-39,-38,-37,-36,-34,-33,-32
  131. 00030  A 10e8      e1e2e3e4e6A          fcb   -31,-30,-29,-28,-26,-25,-24,-23
  132. 00031  A 10f0      ebecedeef0A          fcb   -21,-20,-19,-18,-16,-15,-14,-12
  133. 00032  A 10f8      f5f6f8f9fbA          fcb   -11,-10,-8,-7,-5,-4,-3,-1
  134. 00056                          
  135. 00057  A 1100 86   3c        A dtinit   ldaa  #deftt   set up time counter
  136. 00058  A 1102 97   00        A          staa  ttime    
  137. 00059  A 1104 86   80        A          ldaa  #$80     set dac to halfway point
  138. 00060  A 1106 b7   1004      A          staa  dac      
  139. 00061  A 1109 7f   0005      A          clr   ttflag   no tones please
  140. 00062  A 110c 0f                        sei            set up timer - first disable interrupts
  141. 00063  A 110d fc   100e      A          ldd   tcnt     freeze counter
  142. 00064  A 1110 c3   0100      A          addd  #intcnt  
  143. 00065  A 1113 fd   1016      A          std   ocr1     
  144. 00066  A 1116 86   80        A          ldaa  #ocie    
  145. 00067  A 1118 b7   1022      A          staa  tmsk1    
  146. 00068  A 111b b7   1023      A          staa  tflg1    clear flag if set
  147. 00069  A 111e 0e                        cli            
  148. 00070  A 111f 39                        rts            done for now
  149. 00071                          
  150. 00072  A 1120 84   0f        A dtmf     anda  #$0f     clear out junk
  151.  
  152. M68HC11 Portable Cross Assembler  0.05  dtmf11.asm  Page 4
  153.  Sun Dec 17 12:23:27 1989  
  154. Options - MD,MC,NOG,NOU,W,NOMEX,CL,FMT,O
  155.  
  156. LINE   S PC   OPCO OPERANDS  S LABEL    MNEMO OPERANDS COMMENT
  157. 00073  A 1122 16                        tab            get row interval
  158. 00074  A 1123 ce   11ac      A          ldx   #rowtab  
  159. 00075  A 1126 3a                        abx            
  160. 00076  A 1127 a6   00        A          ldaa  ,x       
  161. 00077  A 1129 97   0a        A          staa  rowint   
  162. 00078  A 112b a6   10        A          ldaa  rowtab-coltab,x and column
  163. 00079  A 112d 97   0b        A          staa  colint   
  164. 00080  A 112f cc   1000      A          ldd   #sine    
  165. 00081  A 1132 dd   06        A          std   rowptr   start at 0
  166. 00082  A 1134 dd   08        A          std   colptr   
  167. 00083  A 1136 96   00        A          ldaa  ttime    start tone - set time
  168. 00084  A 1138 c6   fa        A          ldab  #250     adjust for # of samples in (ttime) msec
  169. 00085  A 113a 3d                        mul            (125/128) * ttime * 4
  170. 00086  A 113b 04                        lsrd           
  171. 00087  A 113c 04                        lsrd           
  172. 00088  A 113d 04                        lsrd           
  173. 00089  A 113e 04                        lsrd           
  174. 00090  A 113f 04                        lsrd           
  175. 00091  A 1140 04                        lsrd           
  176. 00092  A 1141 dd   03        A          std   ttsave   save for pause time
  177. 00093  A 1143 dd   01        A          std   ttctr    
  178. 00094  A 1145 7c   0005      A          inc   ttflag   start tones
  179. 00095  A 1148 12   0501fc 1148 dtmf1    brset ttflag,#1,dtmf1 loop till tone complete
  180. 00096  A 114c dc   03        A          ldd   ttsave   now do pause
  181. 00097  A 114e dd   01        A          std   ttctr    
  182. 00098  A 1150 7f   000a      A          clr   rowint   do the pause by not moving pointers
  183. 00099  A 1153 7f   000b      A          clr   colint   
  184. 00100  A 1156 7c   0005      A          inc   ttflag   start pause
  185. 00101  A 1159 12   0500fc 1159 dtmf2    brset ttflag,#0,dtmf2
  186. 00102  A 115d 39                        rts            done
  187. 00103                          
  188. 00104                          * timer interrupt service routine
  189. 00105                          * if ttctr != 0, then output next sample to dac
  190. 00106                          
  191. 00107  A 115e fc   1016      A tisr     ldd   ocr1     (5) add timer count
  192. 00108  A 1161 c3   0100      A          addd  #intcnt  (4)
  193. 00109  A 1164 fd   1016      A          std   ocr1     (5)
  194. 00110  A 1167 86   80        A          ldaa  #ocie    (2) clear flag
  195. 00111  A 1169 b7   1022      A          staa  tmsk1    (4)
  196. 00112  A 116c 13   05012b 119b          brclr ttflag,#1,tisr1 (6) don't generate tone if flag cleared
  197. 00113  A 1170 de   06        A          ldx   rowptr   (4) get next row sample
  198. 00114  A 1172 18de 08        A          ldy   colptr   (5)
  199. 00115  A 1175 18a6 00        A          ldaa  ,y       (5) get column sample
  200. 00116  A 1178 47                        asra           (2) divide by 4
  201. 00117  A 1179 47                        asra           (2) divide by 4
  202. 00118  A 117a 18ab 00        A          adda  ,y       (5) now have 1.25 * column sample
  203. 00119  A 117d ab   00        A          adda  ,x       (4) add in row sample
  204. 00120  A 117f 88   80        A          eora  #$80     (2) fix sign bit
  205. 00121  A 1181 b7   1004      A          staa  dac      (4)
  206. 00122  A 1184 8f                        xgdx           (3) step to next lookup value - first row ...
  207. 00123  A 1185 db   0a        A          addb  rowint   (3)
  208. 00124  A 1187 dd   06        A          std   rowptr   (4)
  209.  
  210. M68HC11 Portable Cross Assembler  0.05  dtmf11.asm  Page 5
  211.  Sun Dec 17 12:23:27 1989  
  212. Options - MD,MC,NOG,NOU,W,NOMEX,CL,FMT,O
  213.  
  214. LINE   S PC   OPCO OPERANDS  S LABEL    MNEMO OPERANDS COMMENT
  215. 00125  A 1189 188f                      xgdy           (4) ... then column ...
  216. 00126  A 118b db   0b        A          addb  colint   (3)
  217. 00127  A 118d dd   08        A          std   colptr   (4)
  218. 00128  A 118f dc   01        A          ldd   ttctr    (4) decrement timer
  219. 00129  A 1191 83   0001      A          subd  #1       (4)
  220. 00130  A 1194 dd   01        A          std   ttctr    (4)
  221. 00131  A 1196 26   03     119b          bne   tisr1    (3) did count go to zero ?
  222. 00132  A 1198 7f   0005      A          clr   ttflag   ( ) yes - turn off tones
  223. 00133  A 119b 3b               tisr1    rti            (12)
  224. 00134                          *                (12) interrupt response
  225. 00135                          *                ===
  226. 00136                          *                               119 cycles when generating tones
  227. 00137                          *                total overhead at 2 MHz E clock = 119/256 == 46%
  228. 00138                          
  229. 00139  A 119c      2c282c30  A coltab   fcb   col2,col1,col2,col3 0,1,2,3
  230. 00140  A 11a0      282c30    A          fcb   col1,col2,col3 4,5,6
  231. 00141  A 11a3      282c30    A          fcb   col1,col2,col3 7,8,9
  232. 00142  A 11a6      2830      A          fcb   col1,col3 #,*
  233. 00143  A 11a8      36363636  A          fcb   col4,col4,col4,col4 a,b,c,d
  234. 00144                          
  235. 00145  A 11ac      1f171717  A rowtab   fcb   row4,row1,row1,row1 0,1,2,3
  236. 00146  A 11b0      191919    A          fcb   row2,row2,row2 4,5,6
  237. 00147  A 11b3      1c1c1c    A          fcb   row3,row3,row3 7,8,9
  238. 00148  A 11b6      1f1f      A          fcb   row4,row4 #,*
  239. 00149  A 11b8      17191c1f  A          fcb   row1,row2,row3,row4 a,b,c,d
  240. 00150                          
  241. 00151                                   end            
  242.  
  243.  
  244.  
  245. Total number of errors: 0 
  246. Total number of warnings: 0 
  247. Total number of lines: 183 
  248.  
  249.  
  250. Number of bytes in section ASCT: 457 
  251.  
  252. Number of bytes in program: 457
  253.  
  254.